package com.hancai.result;

import lombok.*;

@Getter
@RequiredArgsConstructor
@NoArgsConstructor
public enum CodeEnum {

    OK(200, "成功"),

    FAIL(500, "失败"),

    TOKEN_IS_EMPTY(901,"请求token参数为空"),

    TOKEN_IS_EXPIRED(902,"jwt已经过期"),

    TOKEN_IS_ERROR(903,"请求token有误"),

    TOKEN_NOT_MATCH(904,"请求token不匹配"),

    USER_LOGOUT(200,"退出成功"),
    DATA_ACCESS_EXCEPTION(500,"数据库操作失败")
    ;

    //结果码
    private int code;

    //结果信息
    @NonNull
    private String msg;
    // 构造器
    CodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    // Getter 方法
    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }


}
